package com.apes.fico.masterdata.store.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.fico.masterdata.store.model.TypeStore;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @program: apes-server
 * @description:
 * @author: czs
 * @create: 2023-03-23 11:27
 **/
public interface TypeStoreRepository extends CustomRepository<TypeStore, String> {
    @Query(value = "select A.id\n" +
            "from GL_STORE_TASKS A\n" +
            "WHERE not exists(select 1 from MAS_TYPE_STORE b where b.dept_id = a.DEPT_ID and a.YEAR_MONTH = b.YEAR_MONTH and tasks_type = :amtType )",nativeQuery = true)
    List<String> findAllByNotExists(String amtType);
}
